package com.shop2cn.iapi.productcategory.service;

import java.util.List;

import com.google.gson.reflect.TypeToken;
import com.sun.glass.ui.Pixels.Format;
import com.shop2cn.iapi.productcategory.parameter.BrandInfo;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*查询品牌详细信息列表（后台）Call
*FreeMaker Template自动生成代码
*/
public class QueryBrandInfoListCall extends YmatouBaseCall{
	private static String opurl ="api/admin/QueryBrandInfoList";
	
	public QueryBrandInfoListCall() {
		super(EnvSetup.getSystemUrl("productcategory_shop2cn"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<BrandInfo> getBrandInfoList(){
		String ret = getJsonObject().get("Data").getAsJsonObject().get("BrandInfoList").getAsJsonArray().toString();
		List<BrandInfo> BrandInfoList = (List<BrandInfo>)FormatUtil.GSONToObject(ret, new TypeToken<List<BrandInfo>>(){}.getType());
		return BrandInfoList;
	}
	
}